#include "menu.h"
#include "variable.h"
#include "while.h"




int boucle ()
 {

      //int menu () ;
      //int variable ();

      int done = 1 ;

     while (done)
    {

        SDL_Event event;
        while (SDL_PollEvent(&event))
        {

            switch (event.type)
            {

            case SDL_QUIT:
                done = 0;
                break;

              case SDL_MOUSEBUTTONUP:
           posjouer.x = event.button.x;
           posjouer.y = event.button.y;
           done = 1;



            case SDL_KEYDOWN:
                {
                    if (event.key.keysym.sym == SDLK_SPACE)
                        {done = 1 ;
                        SDL_SetVideoMode(1366,768,32,SDL_FULLSCREEN);}

                    if (event.key.keysym.sym == SDLK_ESCAPE)
                        done = 1 ;

                }
             }
        }

       // SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));
        SDL_BlitSurface(arriereplan, 0 , screen, &dstrect);
        SDL_BlitSurface(jouer, 0, arriereplan, &posjouer);
        SDL_BlitSurface(Options, 0 , arriereplan, &posoptions);
        SDL_BlitSurface(regledujeu, 0 , arriereplan, &posregledujeu);
        SDL_BlitSurface(Quitter, 0 , arriereplan, &posquiter);
        SDL_Flip(screen);

    }
return 0 ;
}
